import axios from 'axios'
// import config from './config.js'
// 获取用户列表
function userList(){
  return new Promise(
    function(resolve,reject){
      axios.get("/users/lists").then(result=>{
        resolve(result.data)
      })
  })
}

// 分页查询获取用户列表
function usersPage(params){
  return new Promise(
    function(resolve,reject){
      axios.get(`/users/lists?page_num=${params.currentPage}&page_size=${params.pageSize}`).then(result=>{
        resolve(result.data)
      })
  })
}
// 搜索用户
function searchUser(params){
  return new Promise(function(resolve,reject){
    axios.post("/users/list",params).then(result=>resolve(result.data))
  })
  
}
// 修改用户信息
function editUser(params){
  return new Promise(function(resolve,reject){
    axios.put("/users/edit",params).then(result=>resolve(result.data))
  })
  
}
export {
  userList,
  usersPage,
  searchUser,
  editUser
}